home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / util / snopdos1 / part01 next >
Encoding:
Internet Message Format  |  1990-10-14  |  55.8 KB

  1. Path: abcfd20.larc.nasa.gov!amiga-request
  2. From: amiga-request@abcfd20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v90i282: SnoopDos 1.00 - Monitors calls to AmigaDOS functions, Part01/02
  4. Reply-To: Eddy Carroll <ECARROLL@vax1.tcd.ie>
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v90i282@abcfd20.larc.nasa.gov>
  7. Date: 14 Oct 90 19:07:04 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga
  11.  
  12. Submitted-by: Eddy Carroll <ECARROLL@vax1.tcd.ie>
  13. Posting-number: Volume 90, Issue 282
  14. Archive-name: util/snoopdos-1.0/part01
  15.  
  16. [ uuencoded executable enclosed  ...tad ]
  17.  
  18. SnoopDos is a little utility that lets you see keep an eye on what other
  19. programs are doing. Specifically, it displays details of any calls a program
  20. makes to AmigaDOS's Open(), Lock(), LoadSeg(), Execute(), CurrentDir() and
  21. DeleteFile() functions.
  22.  
  23. There are several uses for this. Any libraries, devices, or fonts that a
  24. program tries to access will be displayed, which can be useful if the
  25. program isn't overly generous with its error messages. Similarly, you can
  26. see what special startup files a program looks for. Since environment
  27. variables are stored as files in ENV:, you can also see what variables a
  28. program tries to read when you run it. In general, SnoopDos is just a handy
  29. utility to have around when things don't seem to be working quite right.
  30. As an added bonus, SnoopDos works just fine under Workbench 2.0.
  31.  
  32. #!/bin/sh
  33. # This is a shell archive.  Remove anything before this line, then unpack
  34. # it by saving it into a file and typing "sh file".  To overwrite existing
  35. # files, type "sh file -c".  You can also feed this as standard input via
  36. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  37. # will see the following message at the end:
  38. #        "End of archive 1 (of 2)."
  39. # Contents:  makefile res.s snoopdos.doc snoopdos.uu snoopglue.s
  40. #   system.h tiny.a
  41. # Wrapped by tadguy@abcfd20 on Sun Oct 14 15:07:01 1990
  42. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  43. if test -f 'makefile' -a "${1}" != "-c" ; then 
  44.   echo shar: Will not clobber existing file \"'makefile'\"
  45. else
  46. echo shar: Extracting \"'makefile'\" \(799 characters\)
  47. sed "s/^X//" >'makefile' <<'END_OF_FILE'
  48. X#
  49. X# Lattice LKM makefile, for Lattice C V5.04                           :ts=8
  50. X#
  51. X# SnoopDos (C) Copyright Eddy Carroll, May 1990
  52. X#
  53. X
  54. XCFLAGS    = -cusq -j88i -ms -v # -d5
  55. XBFLAGS    = sc sd nd map ram:map
  56. X#BFLAGS    = addsym
  57. XLIBS    = lib:lc.lib lib:amiga.lib
  58. XASM    = lc:asm
  59. X#START   = lib:c.o
  60. XSTART    = tiny.o
  61. X
  62. X.c.o:
  63. X    lc $(CFLAGS) -Hsystem.sym $*.c
  64. X.a.o:
  65. X    $(ASM) -isys:include/ -u $*.a    # Prefix all symbols with C-style _
  66. X.s.o:
  67. X    $(ASM) -isys:include/ $*.s    # Standard "pure" assembly
  68. X.n.doc:
  69. X    nro >$*.doc -ms:an $*.n
  70. X.h.sym:
  71. X    lc1 -ph -o$*.sym $*.h
  72. X
  73. X#
  74. X# Makefile dependencies
  75. X#
  76. Xall: snoopdos
  77. X
  78. XOBJS    = tiny.o snoopdos.o snoopglue.o res.o
  79. X
  80. Xsnoopdos: $(OBJS)
  81. X    blink from $(OBJS) to snoopdos $(BFLAGS) lib $(LIBS)
  82. X
  83. Xsystem.sym:    system.h
  84. Xtiny.o:        tiny.a
  85. Xsnoopdos.o:    snoopdos.c system.sym
  86. Xsnoopglue.o:    snoopglue.s
  87. Xres.o:        res.s
  88. END_OF_FILE
  89. if test 799 -ne `wc -c <'makefile'`; then
  90.     echo shar: \"'makefile'\" unpacked with wrong size!
  91. fi
  92. # end of 'makefile'
  93. fi
  94. if test -f 'res.s' -a "${1}" != "-c" ; then 
  95.   echo shar: Will not clobber existing file \"'res.s'\"
  96. else
  97. echo shar: Extracting \"'res.s'\" \(6516 characters\)
  98. sed "s/^X//" >'res.s' <<'END_OF_FILE'
  99. X*:ts=8
  100. X*****************************************************************************
  101. X*                                                                           *
  102. X* RES.S                                    (C) Copyright Eddy Carroll 1989  *
  103. X*                                                                           *
  104. X* This module allows you to make a duplicate copy of your current process.  *
  105. X* In fact, both processes actually share the same code. However, the        *
  106. X* seglist pointer of the current process is modified so that when the       *
  107. X* process terminates, the memory doesn't get freed (if it did, the new      *
  108. X* process would suddenly find itself deallocated. Hello guru...)            *
  109. X* This code only works when called from CLI processes.                      *
  110. X*                                                                           *
  111. X* The parameters passed are similar to those for CreateProc(), with the     *
  112. X* difference that instead of passing a BPTR to a seglist, you pass the      *
  113. X* address of the function the new process should start executing at.        *
  114. X*                                                                           *
  115. X* When the new process returns from this function, it will be removed from  *
  116. X* the system, and its memory (finally) deallocated.                         *
  117. X*                                                                           *
  118. X* The typical use for a function like this is to allow a program to detach  *
  119. X* itself from a CLI (completely, with no trailing console handles etc.)     *
  120. X* when it is run. This is a convenient feature for the user, if the program *
  121. X* is of the sort designed to sit in the background the whole time, rather   *
  122. X* than do something immediately, then exit.                                 *
  123. X*                                                                           *
  124. X* Lattice provide cback.o which at first glance would seem to provide a     *
  125. X* similar solution. However, cback.o makes it difficult to print error      *
  126. X* messages to the console if there is an error on the command line - by     *
  127. X* the time you spot the error, the CLI prompt has already been printed      *
  128. X* and your error message is printed after it. This looks very messy.        *
  129. X* Res avoids this problem by not spawning the background process until      *
  130. X* after the error checking has been done.                                   *
  131. X*                                                                           *
  132. X* From C, you call it as follows:                                           *
  133. X*                                                                           *
  134. X* pid = res(name,pri,func,stacksize)                                        *
  135. X*                                                                           *
  136. X* name         - pointer to null terminated string                          *
  137. X* pri          - integer, priority of the new process                       *
  138. X* func         - pointer to the function for new process to call            *
  139. X* stacksize    - integer, size of the stack for the new process             *
  140. X*                                                                           *
  141. X* pid          - Process ID of new process, or 0 if none created            *
  142. X*                                                                           *
  143. X*****************************************************************************
  144. X
  145. X    INCLUDE "exec/types.i"
  146. X        INCLUDE "exec/alerts.i"
  147. X        INCLUDE "exec/nodes.i"
  148. X        INCLUDE "exec/lists.i"
  149. X        INCLUDE "exec/ports.i"
  150. X        INCLUDE "exec/libraries.i"
  151. X        INCLUDE "exec/tasks.i"
  152. X        INCLUDE "libraries/dos.i"
  153. X        INCLUDE "libraries/dosextens.i"
  154. X        INCLUDE "workbench/startup.i"
  155. X        INCLUDE "exec/funcdef.i"
  156. X        INCLUDE "exec/exec_lib.i"
  157. X        INCLUDE "libraries/dos_lib.i"
  158. X
  159. X    xref    _exit
  160. X    xref    _DOSBase
  161. X    xdef    _res
  162. X
  163. XAbsExecBase    equ    4
  164. Xsegsize        equ    36        ; Size of fake seg. (code = 28 bytes)
  165. X
  166. X        csect   text,0,0,1,2        * xref's after this are 16-bit reloc
  167. X
  168. X
  169. Xcallsys macro
  170. X        CALLLIB _LVO\1
  171. X    endm
  172. X
  173. X_res:
  174. X    movem.l    d2-d4/a2/a3/a6,-(a7)    ; Save registers
  175. X    move.l    AbsExecBase.w,a6    ; Get base of Exec library
  176. X    moveq    #0,d1            ; Any sort of memory will do
  177. X    moveq    #segsize,d0        ; Get size of fake segment
  178. X    callsys    AllocMem        ; Grab some memory
  179. X    tst.l    d0            ; Did we get any?
  180. X    beq    fatal            ; If not, abort immediately!
  181. X    move.l    d0,a3            ; Save pointer to memory
  182. X    sub.l    a1,a1            ; NULL pointer indicates our process
  183. X    callsys    FindTask        ; Get pointer to our process block
  184. X    move.l    d0,a2            ; Save it
  185. X    move.l    pr_CLI(A2),a0        ; Get BPTR to our process's segarray
  186. X    add.l    a0,a0            ; Convert BPTR to address
  187. X    add.l    a0,a0            ; 
  188. X    move.l    cli_Module(a0),4(a3)    ; Make fake segment point to our code
  189. X    clr.l    cli_Module(a0)        ; Remove process seg. from CLI seglist
  190. X    move.l    #segsize,(a3)        ; Set size of fake seglist
  191. X    lea.l    8(a3),a2        ; Get pointer to first code byte
  192. X
  193. X;
  194. X; Now a tiny machine code program is constructed. It looks like this:
  195. X;
  196. X;    move.l    #$xxxxxx,A4    ; Initialise A4
  197. X;    jsr    $xxxxxx        ; Call user program
  198. X;    move.l    #$xxxxxx,A6    ; Load DOSbase into A6
  199. X;    move.l    #$xxxxxx,d1    ; Get BPTR to this segment 
  200. X;    jmp    UnLoadSeg(A6)    ; Unload our process from memory
  201. X;
  202. X; It's built "on the fly" so to speak, to keep code size down, and also
  203. X; because it's a convenient way of initialising all the variables.
  204. X; Note that a potential problem exists if DOSBase should somehow alter or
  205. X; disappear. We'll assume it will remain relatively stable for the next
  206. X; few years anyway :-)
  207. X;
  208. X
  209. X    move.l    _DOSBase,a6        ; Prepare for DOS call
  210. X    move.w    #$287C,(a2)+        ; Store MOVE.L $xxxxxx,A4 instruction
  211. X    move.l    a4,(a2)+        ; Output value of A4 to initialise to
  212. X    move.w    #$4EB9,(a2)+        ; Store JSR $xxxxxx
  213. X    move.l    36(a7),(a2)+        ; followed by address of user function
  214. X    move.w    #$2C7C,(a2)+        ; Store MOVE.L $xxxxxx,A6 instruction
  215. X    move.l    a6,(a2)+        ; followeds by current DOSbase
  216. X;
  217. X    lea    4(a3),a3        ; Now get seglist ptr to fake segment
  218. X    move.l    a3,d3            ; and convert it to BPTR
  219. X    lsr.l    #2,d3            ; D3 now has seglist ptr to fake seg
  220. X    move.w    #$223C,(a2)+        ; Store MOVE.L $xxxxxx,D1 instruction
  221. X    move.l    d3,(a2)+        ; Followed by BPTR to the segment
  222. X    move.l    #$4EEEFF64,(a2)+    ; Store JMP UnLoadSeg(A6)
  223. X;
  224. X    move.l    28(A7),d1        ; Get pointer to name
  225. X    move.l    32(A7),d2        ; Get process priority
  226. X    move.l    40(A7),d4        ; Get stacksize
  227. X    callsys    CreateProc        ; Create new process
  228. X    movem.l    (a7)+,d2-d4/a2/a3/a6    ; Pop registers
  229. X    rts                ; Return
  230. Xfatal:
  231. X    moveq    #120,d0            ; Set error exit code
  232. X    jmp    _exit            ; And exit
  233. X
  234. X    end
  235. END_OF_FILE
  236. if test 6516 -ne `wc -c <'res.s'`; then
  237.     echo shar: \"'res.s'\" unpacked with wrong size!
  238. fi
  239. # end of 'res.s'
  240. fi
  241. if test -f 'snoopdos.doc' -a "${1}" != "-c" ; then 
  242.   echo shar: Will not clobber existing file \"'snoopdos.doc'\"
  243. else
  244. echo shar: Extracting \"'snoopdos.doc'\" \(14548 characters\)
  245. sed "s/^X//" >'snoopdos.doc' <<'END_OF_FILE'
  246. X
  247. X                SnoopDos V1.0 -- Monitors AmigaDOS function calls
  248. X
  249. X        (C) Copyright Eddy Carroll, September 1990. Freely Distributable.
  250. X
  251. X
  252. XINTRODUCTION
  253. X
  254. X    Have you ever wondered why a particular program won't seem to run?
  255. X    It could be looking for some special files which you've forgotten to
  256. X    install in the appropriate place. SnoopDos was designed to let you
  257. X    resolve situations like this, though it's probably useful for other
  258. X    things too.
  259. X
  260. X    For those who don't like long instruction files, simply run SnoopDos
  261. X    with no options, then run a few application programs and look at the
  262. X    output displayed in SnoopDos's window. Interesting, eh? For those who'd
  263. X    like a more detailed explanation, read on...
  264. X
  265. X    When you start SnoopDos, it opens a console window. In this window
  266. X    appears details of all calls made by any program on the system to the
  267. X    CurrentDir(), DeleteFile, Execute(), LoadSeg(), Lock() and Open()
  268. X    functions in the AmigaDOS library. The exception (as usual) is any
  269. X    program written in BCPL; this includes most of the commands in the C:
  270. X    directory.
  271. X
  272. X    SnoopDos will tell you about all attempts to load libraries, devices
  273. X    and fonts. It will also tell you if a program looks for a specific file
  274. X    (for example in S:) or a specific disk volume or directory. This can be
  275. X    very useful when you're playing with new software which may require
  276. X    certain fonts or other support files.
  277. X
  278. X    An unexpected bonus is that since AmigaDOS environment variables are
  279. X    stored as files, SnoopDos will tell you the names of any environment
  280. X    variables a program tries to read; if you see references to ENV:<name>
  281. X    in the SnoopDos window, then a program is trying to access an environment
  282. X    variable called <name>.
  283. X
  284. X
  285. XUSAGE
  286. X
  287. X    When you start SnoopDos, it automatically detaches itself from the CLI
  288. X    and runs in the background. You can specify a number of options on the
  289. X    command line, either at this time or later on by running SnoopDos again.
  290. X    Each option can be given in lower case or upper case to respectively
  291. X    enable or disable that setting. Alternatively, you can follow the option
  292. X    by `1' or `0' which has the same effect. So, `-d' and `-d1' both enable
  293. X    the "Monitor DeleteFile()" option, whereas `-d' and `-d0' both disable
  294. X    that option. Without further ado, here's an explanation of each setting:
  295. X
  296. X    -a  Normally, SnoopDos uses different colours when displaying messages,
  297. X        to allow events to be easily distinguished from each other. You can
  298. X        force SnoopDos not to use any colour by disabling this option. This
  299. X        can be useful if you only have a 2-colour workbench. If SnoopDos is
  300. X        sending its output to a file, it turns off this option by default
  301. X        (but you can turn it back on again if you like).
  302. X
  303. X    -c  When this option is enabled, SnoopDos prints details of all calls
  304. X        to the CurrentDir() function. A program calls CurrentDir() when it
  305. X        wants to change its current directory to somewhere else. Note that
  306. X        no result is displayed for this function, since AmigaDOS does not
  307. X        allow for the possibility of it ever failing.
  308. X
  309. X    -d  This option allows you to see all calls to the DeleteFile() function,
  310. X        which is called whenever a program wants to delete a file. This can
  311. X        be useful with unknown programs, to make sure that they don't do
  312. X        anything nasty (though in fairness, there are much more effective
  313. X        ways for a rogue program to do damage than by deleting a few files).
  314. X
  315. X    -f  When enabled, this option causes SnoopDos to print out the full
  316. X        path names for files. For example, if a program's current directory
  317. X        is SYS:TOOLS and it tries to open a file called FOO, then the
  318. X        filename would be displayed as SYS:TOOLS/FOO. Normally, it would
  319. X        just be displayed as FOO. Filenames which are so expanded are
  320. X        prefixed by a `>' character. Filenames which already included a full
  321. X        path specification don't have this prefix. This allows you to
  322. X        determine if the calling program specified the full path or not.
  323. X
  324. X    -g  This option enables or disables the monitoring of AmigaDOS's
  325. X        LoadSeg() function. This is used to read in a binary loadfile and is
  326. X        most commonly used for loading in libraries, devices, fonts and
  327. X        handlers, and by third-party DOS shells to load in external commands.
  328. X
  329. X    -l  This option enables or disables the monitoring of AmigaDOS's Lock()
  330. X        function. Programs usually call this function to see if a particular
  331. X        file exists, or as a prelude to some more sophisticated operation on
  332. X        the file.
  333. X
  334. X    -m  This option allows SnoopDos to be activated or deactivated while
  335. X        still leaving it running. It is included merely for completeness;
  336. X        a much easier way to achieve the same affect is to type CTRL-D or
  337. X        CTRL-E in the SnoopDos window.
  338. X
  339. X    -o  This option enables or disables the monitoring of AmigaDOS's Open()
  340. X        function. Whenever a program wants to open a file for reading or
  341. X        writing, it calls this function.
  342. X
  343. X    -w  If several tasks try to call a particular DOS function at the same
  344. X        time, SnoopDos can only handle them one at a time. Normally, what
  345. X        will happen is that the other tasks speed on without waiting for
  346. X        SnoopDos and you see a warning message saying that some function
  347. X        calls were missed (this doesn't happen very often anyway). When the
  348. X        `-w' option is enabled however, SnoopDos will make all the
  349. X        different tasks queue up and take their turn.
  350. X
  351. X        There is one important consequence of this: if a program tries to
  352. X        access a file on a volume not currently mounted (causing AmigaDOS to
  353. X        display a "Please insert volume xyzzy" requester), then SnoopDos will
  354. X        print out the details about the file requested but not whether the
  355. X        request succeeded or not; it can't do this until you respond to the
  356. X        requester. In the meantime, other tasks may now be trying to call
  357. X        AmigaDOS. For example, if you might try to pop open a new CLI with
  358. X        Dmouse or PopCLI, so that you can do an ASSIGN to fake the requested
  359. X        volume. All these tasks will have to wait until the original DOS
  360. X        call has been completed.
  361. X
  362. X        Since this can confuse things (though only for the user), the option
  363. X        is disabled by default. You should only need it if you have to be
  364. X        absolutely sure of catching every action made by several tasks.
  365. X
  366. X    -x  This option enables or disables monitoring of Execute() calls.
  367. X        Unlike most other DOS function calls, the return value from the
  368. X        Execute() is NOT displayed; this is because when an Execute suceeds,
  369. X        the command being executed will most likely making AmigaDOS calls of
  370. X        of its own and if SnoopDos was waiting for Execute() to return, it
  371. X        would skip printing these out.
  372. X
  373. X        Some forms of Execute() will appear to have no associated command
  374. X        to execute. This is normal, and occurs when a program redirects
  375. X        command input from another file.
  376. X
  377. X
  378. X    By default, Snoopdos operates as if you had started it with:
  379. X
  380. X        SnoopDos -a1 -c1 -d1 -f0 -g1 -l0 -m1 -o1 -w0 -x1
  381. X
  382. X    or for those who prefer to use the other command format:
  383. X
  384. X        SnoopDos -a -c -d -F -g -L -m -o -w -x
  385. X
  386. X    There are four additional options as well, which cause immediate
  387. X    actions to be performed. These are:
  388. X
  389. X    -h  Prints out a help screen for SnoopDos. Actually, typing any
  390. X        unrecognised garbage after SnoopDos prints the help screen.
  391. X
  392. X    -q  Sends a message to the version of SnoopDos currently running telling
  393. X        it to remove itself. This is one way to quit SnoopDos, the other
  394. X        way being to type CTRL-C in its window.
  395. X
  396. X    -r  Prints out a brief report giving all the current settings for
  397. X        SnoopDos (eagle-eyed users may spot a striking resemblance between
  398. X        this display and the middle section of the help screen :-). Note
  399. X        that all other command line options are ignored when you use -r.
  400. X
  401. X    -z  Allows you to specify an alternative output file for SnoopDos to
  402. X        send messages to. The filename can follow immediately after the -z,
  403. X        or you can leave a space if you like.
  404. X
  405. X        There are several uses for this function. First of all, you can use
  406. X        it to change the location of the SnoopDos window when it opens, by
  407. X        specifying a filename like -zCON:0/0/640/60/SnoopDos) (for a very
  408. X        short window). You should always make sure the window is at least 77
  409. X        columns wide or the output will look pretty messed up.
  410. X
  411. X        If you specify -zSER: or -zAUX: then SnoopDos will send output to
  412. X        the serial port at the baud rate specified in Preferences. AUX: is
  413. X        slightly preferable to SER: since SnoopDos will then recognise the
  414. X        CTRL-C, CTRL-D and CTRL-E characters when typed on the remote
  415. X        terminal. If you are using a colour ANSI terminal, you may like to
  416. X        re-enable colour by specifying `-a' in conjunction with this option.
  417. X
  418. X        Finally, you can of course redirect output to a normal AmigaDOS file.
  419. X        You would only want to do this if you wanted to keep a permanent
  420. X        record of what went on on your system. This could be useful if you
  421. X        allow remote access to your Amiga and want a record of what people
  422. X        do on your system.
  423. X
  424. X
  425. XTHE SNOOPDOS WINDOW
  426. X
  427. X    The SnoopDos window is divided into a number of columns, as follows:
  428. X
  429. X    Process name
  430. X        The name of the process (or CLI command) that is executing the
  431. X        DOS call in question. If the DOS call is nested (see Res. below)
  432. X        then the process name will be prefixed by '> '.
  433. X
  434. X    Func
  435. X        The function being executed (Open, Lock or Load). Open is printed
  436. X        in white, Lock in orange and Load in black, to allow rows to be
  437. X        quickly identifed at a glance. (Of course, if you've changed your
  438. X        Preferences, the actual colours may be different.) Other values
  439. X        which can appear here are Exec (for Execute), CD (for CurrentDir)
  440. X        and Del (for DeleteFile).
  441. X
  442. X    Filename
  443. X        The name of the file being accessed. Remember that when the `-f'
  444. X        option is enabled, this will be prefixed by a `>' character if the
  445. X        filename displayed was expanded by SnoopDos to include the current
  446. X        directory of the calling process.
  447. X
  448. X    Mode
  449. X        For Open(), this is OLD if an existing file is being opened or NEW
  450. X        if a new file is being opened. For Lock(), this is SHAR if the lock
  451. X        is a shared lock (i.e. several processes can access the same file) or
  452. X        EXCL if it is an exclusive lock (only this process can access the
  453. X        file). It remains empty for LoadSeg().
  454. X
  455. X    Res.
  456. X        The result of the DOS call. This is either `Okay' in white or
  457. X        `Fail' in orange. In general, you learn much more from the `Fail'
  458. X        entries (i.e. the things the program tried to find but couldn't).
  459. X
  460. X        Occasionally, you may see a `>>>>' appearing here. This happens if
  461. X        some other program has also patched DOS library in such a way that
  462. X        the function currently being called calls another DOS function
  463. X        itself. One such program is Rez, which tries to open a program file
  464. X        for reading if you LoadSeg() it. In this case, the `>>>>' indicates
  465. X        that DOS calls are being nested. The DOS calls which are nested
  466. X        will have the associated process name prefixed by `> ' when they
  467. X        are displayed. `> (Done)' is displayed when the top level DOS
  468. X        function exits, and the exit status is displayed on the same
  469. X        line in the Res. column as normal.
  470. X
  471. X    You can type several keys into the SnoopDos window. CTRL-C will terminate
  472. X    SnoopDos. CTRL-D will disable monitoring temporarily (and print a brief
  473. X    message to that effect); CTRL-E enables it again. Pressing Space or any
  474. X    other key will pause the output to the window, as in a CLI window. Press
  475. X    BackSpace to continue. Note that if you have the `-w' option enabled and
  476. X    you pause the output, all functions for which monitoring is enabled will
  477. X    cause the calling process to go to sleep until you restart output again.
  478. X
  479. X    When SnoopDos wants to quit, it makes sure that nobody else has patched
  480. X    the DOS library after it. If something has, SnoopDos will refuse to exit
  481. X    immediately. Instead, it will check approximately every 5 seconds to
  482. X    see if it is safe to exit and as soon as it can, it will.
  483. X
  484. X
  485. XHISTORY
  486. X
  487. X    Version 0.9, May 28th 1990.
  488. X
  489. X        Initial Beta release. No doubt people will find lots of bugs.
  490. X
  491. X    Version 0.91, May 29th 1990.
  492. X
  493. X        Silly bug meant Snoopdos couldn't open its console window unless
  494. X        Conman was installed. Now fixed.
  495. X
  496. X        Improved the way DOS library is patched to make it somewhat more
  497. X        robust (it now works properly with UnixDirs).
  498. X
  499. X    Version 0.92, May 31st 1990.
  500. X
  501. X        Strange bug seemed to manifest itself when Rez was used; the first
  502. X        time a resident program was loaded, the display got messed up. Turns
  503. X        out that Rez calls Open() from within LoadSeg(). Such nesting of
  504. X        DOS calls is now indicated by prefixing the process name printed
  505. X        for any nested operations with a '>'. When the nesting is completed,
  506. X        '> Done' is displayed.
  507. X
  508. X    Version 0.93, June 2nd 1990.
  509. X
  510. X        Added -X option to monitor Execute() calls and reworked assembly
  511. X        language glue a bit to make it easier to modify in future.
  512. X
  513. X    Version 1.00, 9th September 1990.
  514. X
  515. X        First public release. After unexpectedly being sent to the US for
  516. X        the summer (new job), I finally got around to tidying it up.
  517. X        New features include monitoring of DeleteFile() and CurrentDir(),
  518. X        support for alternative devices/files (such as the serial port),
  519. X        colour now optional, a few other cosmetic changes.
  520. X
  521. X
  522. XAUTHOR
  523. X
  524. X    Eddy Carroll
  525. X
  526. X    Email:     ecarroll@vax1.tcd.ie
  527. X    Phone:     +353-1-874540
  528. X    Snailmail: The Old Rectory, Delgany, Co. Wicklow, Ireland.
  529. X
  530. X
  531. XDISTRIBUTION
  532. X
  533. X    SnoopDos may be freely distributed as long as no charge is made other
  534. X    than to cover time and copying costs. If you want to include SnoopDos
  535. X    as part of a commercial package (somehow I doubt it but it never hurts
  536. X    to mention :-) then contact the author listed above. Fred Fish is
  537. X    specifically given permission to include SnoopDos in his fine disk
  538. X    collection.
  539. END_OF_FILE
  540. if test 14548 -ne `wc -c <'snoopdos.doc'`; then
  541.     echo shar: \"'snoopdos.doc'\" unpacked with wrong size!
  542. fi
  543. # end of 'snoopdos.doc'
  544. fi
  545. if test -f 'snoopdos.uu' -a "${1}" != "-c" ; then 
  546.   echo shar: Will not clobber existing file \"'snoopdos.uu'\"
  547. else
  548. echo shar: Extracting \"'snoopdos.uu'\" \(16885 characters\)
  549. sed "s/^X//" >'snoopdos.uu' <<'END_OF_FILE'
  550. Xbegin 644 snoopdos
  551. XM```#\P`````````"``````````$```K"```"6@```^D```K"2.=^_DOO`#0D6
  552. XM2"0`2?D`````+'@`!"E.`!`I3P`8D\E.KO[:)D`@#9"M``0&@````(`I0``$D
  553. XM0^P`)'``3J[]V"E``!QF```(<&1@``#H(&L`K-'(T<@B:``0T\G3R2`"<@`2$
  554. XM&2E)`"#0@5*`0F=2@`)`__Z?P%6`0G<(`"`"4X#4@1^R```@`%."4<C_]A^\V
  555. XM`"`@`%."'[$@`"``4<K_^")/G_P```&0)$\F2G0`831E$F?Z0>G__V$<82AFL
  556. XM_$(I__]@ZB!)80YA&F3\0BG__V$29OQGV"3(4D(,0@!D8R)P;F!0$!EG)@P`F
  557. XM`")G%@P``"!G"@P```EG!`P```H"/``>3G4`/``!`CP`^TYU+PLO`D?Y```"7
  558. XM('(`(#P```'28`(FP5'(__Q.NA?@<`!@!"`O``0O`"QX``0B;``<3J[^8B`?@
  559. XM+FP`&$S??WY.=0``+P<N+P`(("P`]%*L`/1*@&9"2JP%JF<*+RP%JDZZ(\Y8-
  560. XM3TJL!;)G#"(L!;(L;``<3J[_W$JL!;9G#"(L!;8L;``<3J[_W'#_OH!G""\')
  561. XM3KK_D%A/+A].=5!R;V-E<W,@;F%M92`@("`@("`@("!&=6YC("!&:6QE;F%MV
  562. XM92`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@36]D92!297,N#0HMF
  563. XM+2TM+2TM+2TM+2T@("`@("`@("`@+2TM+2`@+2TM+2TM+2T@("`@("`@("`@+
  564. XM("`@("`@("`@("`@("`@("`@("`@("TM+2T@+2TM+0T*``!/3$0@``!.15<@H
  565. XM```;6S,S;4Y%5QM;,&T@`%(O5R```!M;,S)M4B]7&ULP;2``/S\_(```4TA!J
  566. XM4@``15A#3```&ULS,VU%6$-,&ULP;0`_/S\_``!/:V%Y#0H``$9A:6P-"@```
  567. XM&ULS,VU&86EL&ULP;0T*`#X`&ULS,VT^&ULP;0``/B`H1&]N92D``%=A<FYI]
  568. XM;F<Z($UI<W-E9``;6S,S;5=A<FYI;F<Z&ULP;2!-:7-S960``#X^/CX-"@``4
  569. XM3W!E;@``3&]C:P``&ULS,VU,;V-K&ULP;0!,;V%D```;6S,R;4QO860;6S!M;
  570. XM`$5X96,``!M;,S)M17AE8QM;,&T`0T0@(```1&5L(```&ULS,VU$96P;6S!M2
  571. XM(`!204T`.BXN+B\`*@!3;F]O<$1O<R!0;W)T`%-N;V]P1&]S.B!#86XG="!A4
  572. XM;&QO8V%T92!M97-S86=E('!O<G0N"@!3;F]O<$1O<SH@0V%N)W0@86QL;V-A.
  573. XM=&4@96YO=6=H('-I9VYA;',N"@!3;F]O<$1O<SH@0V%N)W0@;W!E;B!F:6QE6
  574. XM("5S(&9O<B!O=71P=70N"@`-"E-N;V]P1&]S(%8Q+C`P("A#*2!#;W!Y<FEG:
  575. XM:'0@161D>2!#87)R;VQL+"!397!T(#$Y.3`N($9R965L>2!D:7-T<FEB=71A<
  576. XM8FQE+@T*#0H`0T]..C`O,"\V-#`O,3(P+U-N;V]P1&]S(%8Q+C`P("A#*2!#S
  577. XM;W!Y<FEG:'0@161D>2!#87)R;VQL+"!397!T(#$Y.3`N($9R965L>2!D:7-TO
  578. XM<FEB=71A8FQE+@!3;F]O<$1O<SH@0V%N)W0@;W!E;B!D:7-P;&%Y('=I;F1O-
  579. XM=RX*``I4>7!E($-44DPM12]#5%),+40@=&\@96YA8FQE+V1I<V%B;&4@<VYOT
  580. XM;W!I;F<N(%1Y<&4@0U123"U#('1O(&5X:70N"@H```I3;F]O<&EN9R!N;W<@<
  581. XM9&ES86)L960[('1Y<&4@0U123"U%('1O(&5N86)L92!I="!A9V%I;BX-"@T*?
  582. XM`%-N;V]P:6YG(&YO=R!E;F%B;&5D.R!T>7!E($-44DPM1"!T;R!D:7-A8FQE&
  583. XM(&ET(&%G86EN+@T*#0HE<P``/B`E<P``)2TR,7,@)7,@)7,E+3,Y<R`E<R``H
  584. XM`"``)2TR,7,@)7,@)7,E+30T<R``)2TR,7,@)7,@("5S#0H``"4M-S-S`"5S;
  585. XM(&%N($]P96XH*0T*```E<R!A($QO8VLH*0T*`"5S(&$@3&]A9%-E9R@I#0H`S
  586. XM`"5S(&%N($5X96-U=&4H*0T*`"5S(&$@0W5R<F5N=$1I<B@I#0H`)7,@82!$"
  587. XM96QE=&5&:6QE*"D-"@`-"E-O;65O;F4@96QS92!H87,@<&%T8VAE9"!D;W,N6
  588. XM;&EB<F%R>2!S;R!))VQL(&AA=F4@=&\@=V%I="!U;G1I;"!T:&5Y('%U:70NR
  589. XM#0H``%1H:7,@=VEN9&]W('=I;&P@8VQO<V4@<VAO<G1L>2!T:&]U9V@@=&\@\
  590. XM<W1O<"!I="!F<F]M(&%N;F]Y:6YG('EO=2X-"@`-"E-N;V]P1&]S('1E<FUII
  591. XM;F%T960N#0H``"UZ(&UU<W0@8F4@9F]L;&]W960@8GD@82!F:6QE;F%M92X@O
  592. XM5'EP92!3;F]O<$1O<R`M:"!F;W(@:&5L<"X*``!5;G)E8V]G;FES960@;W!TM
  593. XM:6]N("5S+B!4>7!E(%-N;V]P9&]S("UH(&9O<B!H96QP+@H`4VYO;W!$;W,@5
  594. XM5C$N,#`@*$,I($-O<'ER:6=H="!%9&1Y($-A<G)O;&PL(%-E<'0@,3DY,"X@@
  595. XM1G)E96QY(&1I<W1R:6)U=&%B;&4N"@I3;F]O<$1O<R!M;VYI=&]R<R!C86QL#
  596. XM<R!M861E('1O('9A<FEO=7,@06UI9V%$3U,@9G5N8W1I;VYS(&)Y(&%L;"!P8
  597. XM<F]C97-S97,*;VX@=&AE('-Y<W1E;2X@5&AE(&9O;&QO=VEN9R!O<'1I;VYS`
  598. XM(&%R92!A=F%I;&%B;&4N(%5S92`M>#$@;W(@:G5S="`M>"!T;PIE;F%B;&4@*
  599. XM86X@;W!T:6]N+"`M6"!O<B`M>#`@=&\@9&ES86)L92!T:&%T(&]P=&EO;BX@>
  600. XM0W5R<F5N="!S971T:6YG<R!I;B`H+2DN"@H`0W5R<F5N="!3;F]O<$1O<R!S6
  601. XM971T:6YG<SH*"@``("`@("UA("!5<V4@04Y322!C;VQO=7(@<V5Q=65N8V5SR
  602. XM("`@("`@("`@("`@("`@("`@("`@)7,*`"AO;BD``"AO9F8I`"`@("`M8R`@,
  603. XM36]N:71O<B!#=7)R96YT1&ER*"D@8V%L;',@("`@("`@("`@("`@("`@("`@J
  604. XM("5S"@`@("`@+60@($UO;FET;W(@1&5L971E1FEL92@I(&-A;&QS("`@("`@N
  605. XM("`@("`@("`@("`@("`E<PH`("`@("UF("!$:7-P;&%Y(&9U;&P@9FEL96YAM
  606. XM;64@<&%T:',@("`@("`@("`@("`@("`@("`@)7,*`"`@("`M9R`@36]N:71O>
  607. XM<B!,;V%D4V5G*"D@8V%L;',@("`@("`@("`@("`@("`@("`@("`@("5S"@`@3
  608. XM("`@+6P@($UO;FET;W(@3&]C:R@I(&-A;&QS("`@("`@("`@("`@("`@("`@*
  609. XM("`@("`@("`E<PH`("`@("UM("!';&]B86QL>2!E;F%B;&4O9&ES86)L92!M)
  610. XM;VYI=&]R:6YG("`@("`@("`@("`@)7,*`"`@("`M;R`@36]N:71O<B!/<&5NQ
  611. XM*"D@8V%L;',@("`@("`@("`@("`@("`@("`@("`@("`@("5S"@`@("`@+7<@F
  612. XM($1I<W!L87D@86QL(&%C=&EV:71Y+"!S;&5E<&EN9R!I9B!N96-E<W-A<GD@[
  613. XM("`E<PH`("`@("UX("!-;VYI=&]R($5X96-U=&4H*2!C86QL<R`@("`@("`@B
  614. XM("`@("`@("`@("`@("`@)7,*``H@("`@+6@@(%!R:6YT(&]U="!T:&ES(&AEK
  615. XM;'`@;65S<V%G90H@("`@+7$@(%1E;&P@4VYO;W!$;W,@=&\@<75I=`H@("`@?
  616. XM+7(@(%)E<&]R="!C=7)R96YT(%-N;V]P1&]S('-E='1I;F=S"B`@("`M>B4@:
  617. XM3W5T<'5T('1O(&9I;&4@)2`H92YG+B`M>D-/3CHP+S`O-C0P+S$P,"]3;F]O0
  618. XM<$1O<R!O<B`M>E-%4CHI"@H``%1H97)E(&ES(&YO(&)A8VMG<F]U;F0@4VYO`
  619. XM;W!$;W,@<')O8V5S<R!T;R!T96QL('1O('%U:70A"@!3;F]O<$1O<P``0V]UE
  620. XM;&1N)W0@<W!A=VX@8F%C:V=R;W5N9"!3;F]O<$1O<R!T87-K+@H`3E4``$CG4
  621. XM/Q`F;0`(+BT`#"PM`!`J+0`4*"T`&"\M`"`O+0`<+P0O!2\&+P<O"TAL!B).\
  622. XMNABJ+&P`'$ZN_\1![`8B(DA*&6;\4XF3R"(`)`@F"4ZN_]!,[0C\_^1.74YU`
  623. XM3E4``$CG/Q`N+0`()FT`#"PM`!`J+0`4*"T`&"\M`"0O+0`@+RT`'"\$+P4ON
  624. XM!B\+2&P&(DZZ&$A![`8B(DA*&6;\4XF3R"(')`@F"2QL`!Q.KO_03.T(_/_DB
  625. XM3EU.=4Y5_]1(YP,0+BT`""PM``PF;0`0D\DL>``$3J[^VB!`0^@`7!M\``7_K
  626. XMY#M\`"3_[BM)_^HK0/_P*T?_]"M&__@K2__\*T#_V"M)_]0@;`6F0^W_W$ZNH
  627. XM_I(@;?_43J[^@"!M_]1.KOZ,3-\(P$Y=3G5.5?[02.<W,"XM``B3R2QX``1.M
  628. XMKO[:($`K:`"X__@L/````2M#[?[H(@D"0?_\0JW^W'3_(4(`N"M`__PK0?[@"
  629. XM(@<L;``<3J[_H"H`0>P"($(P:``B!20M_N`L;``<3J[_FDJ`9@12K?[<($)0I
  630. XMB"M(_^Q*$&8(0_KUF"M)_^P@;?_L2AAF_%.(D>W_["`((@:2@"P!4X8K0/[8`
  631. XM(@5.KO\N*T#^U"(%3J[_IBHM_M1![`(@T<8O+?[8+RW_["\(3KH5LD_O``Q*W
  632. XMA6<4(`8B+?[8T(%![`(@$;P`+P@`8!`@!M"M_MA![`(@$;P`.@@`2H5F`/]B,
  633. XM(&W__"%M__@`N$JM_MQG6B`'Y8`@0"(H`!#E@2)!)"D`*.6")$)'Z@`!=@`6F
  634. XM$B\#+PM(;`(@*T#^V"M!_M0K0O[03KH5.G``(&W^T!`00>P"($(P``!(>O3(/
  635. XM2&P"($ZZ%4)![`(@(`A@"$'L`B#1QB`(3.T,[/ZT3EU.=4Y5__!(YP\P)FT`&
  636. XM""XM``PD;0`0*TK__'H`($I#^O2,$!BP&6842@!F]F8.($HB2Q+89OQP`&``9
  637. XM`+0O!V$`_E)83R!`(DL2V&;\($M*&&;\4XB1RRP(2H5F*'`ZL!)F(GH!?`!*'
  638. XM,V@`9PQP.K`S:`!G!%*&8.YP.K`S:`!F:%*&8&1P+[`29B8H!E6$2H1K%'`O3
  639. XML#-(`&<,<#JP,T@`9P13A&#H2H1K/BP$4H9@.$J%9B8K2O_P(&W_\$H09QIP:
  640. XM.K`09@X@;?_\(DL2V&;\<`!@&E*M__!@WB!+T<8B2A#99OQP`6`&4HI@`/]L\
  641. XM3-\,\$Y=3G5.5?_(2.<W('X`?`%Z`'``+P!(>O.D*T#_\$ZZ%FY03RE`!:IFU
  642. XM&$AZ\YXO+`6V80#\GDAX__]A`/%B8``)#BEL!:H%IG``(&P%IA`H``]R`20!:
  643. XMX:(I0@E:</\L>``$3J[^MG(!)`'AHBE""4)P_TZN_K9R`20!X:(I0@E&</].:
  644. XMKOZV<@$D`>&B*4()2G#_3J[^MG(!)`'AHBE""4YP_TZN_K9R`20!X:(I0@E2W
  645. XM</].KOZV<@'AH2E!"59P_["L"4)G'+"L"49G%K"L"4IG$+"L"4YG"K"L"5)G&
  646. XM!%*!9AA(>O,.+RP%MF$`^^9(>/__80#PJF``"%9*K`6Z9T9![`6^(@@D/```#
  647. XM`^XL;``<3J[_XBE`!;)F'$AL!;Y(>O+\+RP%MF$`^ZI(>/__80#P;F``"!I(N
  648. XM>O,.+RP%LF$`^Y)03V`R0?KS4"(()#P```/N+&P`'$ZN_^(I0`6R9AA(>O.2;
  649. XM+RP%MF$`^VA(>/__80#P+&``!]@B+`6V+&P`'$ZN_]Q"K`6V2JP%NF8.2'KSO
  650. XMBB\L!;)A`/LZ4$\O+``P+RP%LF$`^RQ![`5X+'@`!$ZN_=*3R4ZN_MHI0`6N?
  651. XM3KH.UE!/2H=F``;"("P)6H"L"4*`K`E&@*P)2H"L"4Z`K`E2@*P)5@!`$```/
  652. XM0"```$!``"QX``1.KO["*T#_[`@```QG`GX!"```#6<:2JP`[&<42'KS3B\LG
  653. XM!;)A`/JV4$]P`"E``.P(+0`&_^YG($JL`.QF&B\L`#!(>O-D+RP%LF$`^I!/M
  654. XM[P`,<`$I0`#L("W_["(L"4+"@&<&".T``/_S(BP)1L*`9P8([0`!__,B+`E*]
  655. XMPH!G!@CM``+_\R(L"4["@&<&".T``__S(BP)4L*`9P8([0`$__,B+`E6PH!GO
  656. XM!@CM``7_\\"L"5IG``3D(&P%IBQX``1.KOZ,*T#_Z$J`9P`$SB)`(&D`%"MH<
  657. XM``K_Y"(H`*SE@2MH`)C_W"M!_^!*AF8\)"D`&'8#M(-G&'8%M(-G$G8'M(-GF
  658. XM#'8*M(-G!G8+M(-F&GH!)"P`\.6"0>P`E"\P*``O+`6R80#YME!/2JW_X&=HX
  659. XM(&W_X$JH`#QG7B`H`!#E@$CM``'_S"!`$A!T`+("8VA#Z``!<``0`2\`+PE(N
  660. XM;`1Z3KH0ND_O``QP`"!M_\P0$$'L!'I",`@`0>P$>BM(_^1*A6<T0>P$>!"\S
  661. XM`#X1?``@``$K2/_D8"!*A6<<+RW_Y$AZ\D1(;`1X3KH1L$_O``Q![`1X*TC_I
  662. XMY"!M_^@K:``@_]1"K?_0("@`&`R`````#60``[C00#`[``9.^P`$`!@`'@`VN
  663. XM`$X#1`$J`T0!Y`-$`E`"?`+:`T1^`6```XYP)T'L`,PD;?_H(FH`(!+84<C_,
  664. XM_&```W9P)R)M_^@@:0`@0^P`S!+84<C__&```UX@;?_H("@`'`R````#[6843
  665. XM(BP`\"0!Y8)![``T*W`H`/_88$@,@````^YF%"(L`/`D`>6"0>P`/"MP*`#_9
  666. XMV&`L#(````/L9A0@+`#P(@#E@4'L`$0K<!@`_]A@$"`L`/#E@$'L`$PK<`@`%
  667. XM_]A*K`#D9R0@;?_H+R@`("\M_]Q(;`-,80#Z:$_O``Q![`-,*T#_T"M(_]0@*
  668. XM+`#PY8!*K?_09PI![`!\('`(`&`$0?KQ)B\M_]@O+?_4+PA#[`"<+S$(`"\M7
  669. XM_^1(>O#V+RP%LF$`]]Y/[P`<?`!@``*"(&W_Z"`H`!QR_K"!9A0B+`#P)`'E(
  670. XM@D'L`%0K<"@`_]A@*%*`9A0@+`#P(@#E@4'L`%PK<!@`_]A@$"`L`/#E@$'L&
  671. XM`&0K<`@`_]A*K`#D9R0@;?_H+R@`("\M_]Q(;`-,80#YKD_O``Q![`-,*T#_@
  672. XMT"M(_]0@+`#PY8!*K?_09PI![`!\('`(`&`$0?KP;"\M_]@O+?_4+PA#[`"D6
  673. XM+S$(`"\M_^1(>O`\+RP%LF$`]R1/[P`<?`!@``'(2JP`Y&<D(&W_Z"\H`"`OA
  674. XM+?_<2&P#3&$`^3Y/[P`,0>P#3"M`_]`K2/_4("P`\.6`2JW_T&<*0>P`?"!PZ
  675. XM"`!@!$'Z[_PO+?_4+PA#[`"L+S$(`"\M_^1(>N_H+RP%LF$`]KA/[P`8?`!@F
  676. XM``%<("P`\.6`+RW_U$'L`+0O,`@`+RW_Y$AZ[\XO+`6R80#VC$_O`!1\`6``7
  677. XM`3`@;?_H+R@`'&$`]T183R!`2AAF_%.(D<`K0/_,2.T!`/_(<B\@0"0M_\BRI
  678. XM,"C_9@1","C_(BP`\.6!+P!#[`"\+S$8`"\M_^1(>N]P+RP%LF$`]BY/[P`49
  679. XM?`%@``#22JP`Y&<D(&W_Z"\H`"`O+?_<2&P#3&$`^$A/[P`,0>P#3"M`_]`K%
  680. XM2/_4("P`\.6`2JW_T&<*0>P`?"!P"`!@!$'Z[P8O+?_4+PA#[`#$+S$(`"\ME
  681. XM_^1(>N[R+RP%LF$`]<)/[P`8?`!@9DJ&9R1*A6<@("P`\.6`0>P`A"\P"`!(Y
  682. XM>N[J+RP%LF$`]9A/[P`,>@`@;?_H2J@`'&<:("P`\.6`0>P`;"\P"``O+`6R,
  683. XM80#U<E!/8!@@+`#PY8!![`!T+S`(`"\L!;)A`/584$]\`2)M_^@L>``$3J[^\
  684. XMAF``^R!*K?_P9P#Z+DJ&9P#Z*`@M``#_\V<>("P`\.6`0>P`C"\P"`!(>NYL8
  685. XM+RP%LF$`]11/[P`,""T``?_S9QX@+`#PY8!![`",+S`(`$AZ[E8O+`6R80#TA
  686. XM[D_O``P(+0`"__-G'B`L`/#E@$'L`(PO,`@`2'KN/B\L!;)A`/3(3^\`#`@M#
  687. XM``/_\V<>("P`\.6`0>P`C"\P"`!(>NXJ+RP%LF$`]*)/[P`,""T`!/_S9QX@X
  688. XM+`#PY8!![`",+S`(`$AZ[A8O+`6R80#T?$_O``P(+0`%__-G'B`L`/#E@$'L3
  689. XM`(PO,`@`2'KN!"\L!;)A`/163^\`#$*M__!@`/D\(FP%IBQX``1.KOZ8(&P%E
  690. XMID*H``I.N@C`2H!F6D*M_^Q(>NW@+RP%LF$`]!Y03TJL!;IF#DAZ[APO+`6R(
  691. XM80#T"E!/<GW2@2QL`!Q.KO\Z2JP%LF<:4JW_[`RM`````O_L;PPB+`6R3J[_B
  692. XMW$*L!;).N@AF2H!GS$JL!;)G#DAZ[AHO+`6R80#SPE!/(&P%IBQX``1.KOZ,,
  693. XM*T#_[$J`9P@B0$ZN_H9@Y$'L!7@L>``$3J[]S'(*+&P`'$ZN_SI(>/__80#HX
  694. XM4DSM!.S_L$Y=3G5.5?_P2.<O,"XM``@F;0`,?`!Z`'@`0_KJ3"QX``1.KOYZW
  695. XM*4`%IF<22&P`S$*G2'@``6$`\Z1/[P`,<`&^@&\``8X@:P`$<BVR$&8``8)#"
  696. XMZ``!#!$`86400^@``G(PLA%G!BM`__!@!$*M__!#Z``!<@`2$47L`1T(,@``!
  697. XM&`!G"G0`%`%R(-2!8`I#Z``!<``0$20`=F&4@VT``10,@@```!IL``$*U$(T=
  698. XM.R`&3OL@!``R`/P`/@!(`/P`4@!<`&8`_`#\`/P`;`!V`/P`@`#\`(H`D`#\V
  699. XM`/P`_`#\`)8`G@#\`*8I;?_P`/!X`6```-@I;?_P`-Q@``#.*6W_\`#@8```$
  700. XMQ"EM__``Y&```+HI;?_P`-1@``"P?`%@``"J*6W_\`#08```H"EM__``[&``=
  701. XM`)8I;?_P`,Q@``",>@%@``"&?`)@``"`*6W_\`#H8'8I;?_P`-A@;B!K``14C
  702. XMB$H09Q!#[`6^$MAF_'`!*4`%NF`:6(M3AW`!OH!O$"!L!;HB:P`$$-EF_"E`E
  703. XM!;I*K`6Z9A)(>NQ080#Q@DAX``5.NN:&4$]*A&8>0JP`\&`8+RL`!$AZ['!A;
  704. XM`/%B2'@`!4ZZYF9/[P`,6(M3AV``_FYP`;Z`;P(L`$J&9P`!3KR`9@Q(>NQVC
  705. XM80#Q-%A/8`I(>NV<80#Q*%A/2JP`\&<&0?KMY&`$0?KMY"\(2'KMGF$`\0Q0$
  706. XM3TJL`-QG!D'Z[<A@!$'Z[<@O"$AZ[<AA`/#P4$]*K`#@9P9!^NVL8`1!^NVLO
  707. XM+PA(>NWF80#PU%!/2JP`Y&<&0?KMD&`$0?KMD"\(2'KN!&$`\+A03TJL`-1GO
  708. XM!D'Z[71@!$'Z[70O"$AZ[B)A`/"<4$]*K`#09P9!^NU88`1!^NU8+PA(>NY`U
  709. XM80#P@%!/2JP`[&<&0?KM/&`$0?KM/"\(2'KN7F$`\&103TJL`,QG!D'Z[2!@;
  710. XM!$'Z[2`O"$AZ[GQA`/!(4$]*K`#H9P9!^NT$8`1!^NT$+PA(>NZ:80#P+%!/+
  711. XM2JP`V&<&0?KLZ&`$0?KLZ"\(2'KNN&$`\!!03W`!O(!F"DAZ[N)A`/``6$](+
  712. XM>``%80#E(EA/2JP%IF<P2H5G$D*G<``O`"\`80#PG$_O``Q@$DAL`,Q"ITAX5
  713. XM``)A`/"(3^\`#$*G80#D[%A/2H5G$$AZ[TAA`.^R0I=A`.386$]!^N;N(@@DA
  714. XM/````^XL;``<3J[_XBE`!;9(>`^@2'KS'$AX``5(>N].3KH&4D_O`!!*@&826
  715. XM2'KO2&$`[VY(>``*80#DDE!/3-\,]$Y=3G5(YR,8)D$N`DGY`````$JL`.QG<
  716. XM``"`2JP`S&=XD\DL>``$3J[^VK"L!:YG:$JL`.AG"D'L!7A.KOW,8")![`5X!
  717. XM3J[]P$J`9A8B;`6N("P)0DZN_KPB"R0'3KH%3F`^+PLO!TAX``-A`.^P(@LDB
  718. XM!TZZ!3@L`$*7+P9(>``$80#OFD_O`!1![`5X+'@`!$ZN_<8@!F`((@LD!TZZ%
  719. XM!0Y,WQC$3G5(YR,8)D$N`DGY`````$JL`.QG``"`2JP`T&=XD\DL>``$3J[^,
  720. XMVK"L!:YG:$JL`.AG"D'L!7A.KOW,8")![`5X3J[]P$J`9A8B;`6N("P)1DZNY
  721. XM_KPB"R0'3KH$N&`^+PLO!TAX``5A`.\.(@LD!TZZ!*(L`$*7+P9(>``&80#N<
  722. XM^$_O`!1![`5X+'@`!$ZN_<8@!F`((@LD!TZZ!'A,WQC$3G5(YP$8)D%)^0```
  723. XM``!*K`#L9WI*K`#49W23R2QX``1.KO[:L*P%KF=D2JP`Z&<*0>P%>$ZN_<Q@X
  724. XM($'L!7A.KOW`2H!F%")L!:X@+`E*3J[^O"(+3KH$*&`Z+PM"ITAX``=A`.YR#
  725. XM(@M.N@04+@!"ER\'2'@`"&$`[EY/[P`40>P%>"QX``1.KOW&(`=@!B(+3KH#G
  726. XM[$S?&(!.=4CG,Q@F02X"+`-)^0````!*K`#L9V9*K`#89V"3R2QX``1.KO[:0
  727. XML*P%KF=02JP`Z&<*0>P%>$ZN_<Q@)$'L!7A.KOW`2H!F&")L!:X@+`E.3J[^1
  728. XMO"(+)`<F!DZZ`Y1@)B\+0J=(>``)80#MTD_O``Q![`5X+'@`!$ZN_<8B"R0'D
  729. XM)@9.N@-L3-\8S$YU2.<!""X!2?D`````2JP`[&=B2JP`W&=<D\DL>``$3J[^<
  730. XMVK"L!:YG3$JL`.AG"D'L!7A.KOW,8"!![`5X3J[]P$J`9A0B;`6N("P)4DZNE
  731. XM_KPB!TZZ`QQ@(D*G+P=(>``*80#M3D_O``Q![`5X+'@`!$ZN_<8B!TZZ`OA,C
  732. XMWQ"`3G5(YP$8)D%)^0````!*K`#L9WA*K`#@9W*3R2QX``1.KO[:L*P%KF=B#
  733. XM2JP`Z&<*0>P%>$ZN_<Q@($'L!7A.KOW`2H!F%")L!:X@+`E63J[^O"(+3KH"^
  734. XMJ&`X+PM"ITAX``MA`.S.(@M.N@*4+@!"ER\'2'@`#&$`[+I/[P`40>P%>"QX$
  735. XM``1.KOW&8`8B"TZZ`FY,WQB`3G5(YP#R+'D````$('D````<".@``0`.3*@.4
  736. XM`/_B2+D.`````/A,N0X````AXDBH#@#_XDRH#@#_K$BY#@````#^3+D.````J
  737. XM(>A(J`X`_ZQ,J`X`_VI(N0X````!!$RY#@```"'N2*@.`/]J3*@.`/\B2+D.L
  738. XM`````0I,N0X````A]$BH#@#_(DRH#@#_@DBY#@````$03+D.````(?I(J`X`A
  739. XM_X),J`X`_[A(N0X````!%DRY#@```"(`2*@.`/^X(DA.KOY63-]/`$YU2.<`P
  740. XM\BQY````!"!Y````'"`Y```AY+"H_^1F``"L(#D``"'JL*C_KF8``)X@.0``!
  741. XM(?"PJ/]L9@``D"`Y```A]K"H_R1F``""(#D``"'\L*C_A&8``'0@.0``(@*PU
  742. XMJ/^Z9@``9@CH``$`#DRY#@````#X2*@.`/_B3+D.`````/Y(J`X`_ZQ,N0X`C
  743. XM```!!$BH#@#_:DRY#@````$*2*@.`/\B3+D.`````1!(J`X`_X),N0X````!@
  744. XM%DBH#@#_N")(3J[^5G`!8`)P`$S?3P!.=4[Y```B!D[Y```B&$[Y```B*D[Y/
  745. XM```B/$[Y```B3D[Y```B8$CG/SY.N0``',I,WWS\(@!.=4CG/SY.N0``'6Q,'
  746. XMWWS\(@!.=4CG/SY.N0``'@Y,WWS\(@!.=4CG/SY.N0``'J9,WWS\(@!.=4CG1
  747. XM/SY.N0``'S),WWS\(@!.=4CG/SY.N0``'[),WWS\(@!.=4'Y````^#`\_^)@(
  748. XM/D'Y````_C`\_ZQ@,D'Y```!!#`\_VI@)D'Y```!"C`\_R)@&D'Y```!$#`\\
  749. XM_X)@#D'Y```!%C`\_[A@`DYQ2.=S`CP0#$9.^68``!`@:``"+'D````<3I!@,
  750. XM&#P02(9(QL%&/B@`!"QY````'-Y&3K9P!$S?0,Y.=0``2.<X,BQX``1R`'`D1
  751. XM3J[_.DJ`9P``;"9`D\E.KO[:)$`@:@"LT<C1R"=H`#P`!$*H`#PFO````"1%T
  752. XMZP`(+'D````<-/PH?"3,-/Q.N23O`"0T_"Q\),Y'ZP`$)@ODBS3\(CPDPR3\;
  753. XM3N[_9"(O`!PD+P`@*"\`*$ZN_W9,WTP<3G5P>$[Y```!,$CG(#`F;P`0)$M*"
  754. XM$F<D<``0$D'L`1T(,``!"`!G"G(`$@!T()*"8`1R`!(`%(%2BF#8(`M,WPP$/
  755. XM3G4``````````'!A(F\`""!O``0@+P`,(@A@!!#99PA3@&3X8`9"&%.`9/H@!
  756. XM`4YU(F\`""!O``0@"$H89OQ3B!#99OQ.=0``("\`""!O``1.5?_T(D]R"DZZZ
  757. XM`9P&00`P$L%*@&;P(`D0X;_)9OI"$)"/3EU.=0``("\`""!O``1.5?_T(D\B[
  758. XM``)!``<&00`P$L'FB&;P(`D0X;_)9OI"$)"/3EU.=0``,#$R,S0U-C<X.6%B)
  759. XM8V1E9B`O``@@;P`$0^\`!#(``D$`#Q+[$-SHB&;R(`DB#UB!$.&RB6;Z0A"08
  760. XM@4YU(&\`!")(<@!P`"\"#!``*V<&#!``+68"4D@0&`0``#!M$@P```EN#"0!B
  761. XMY8'2@M*!TH!@Y@P1`"UF`D2!)!\@"%.`(&\`"""!D(E.=2\'+B\`"%*L"60@4
  762. XM!R!L"6`0P"E("6`N'TYU3E4``$CG`#`F;P`0)&\`%$*L"60I2PE@2&T`$"\*Z
  763. XM2'K_QDZZ!6`@;`E@0A`@+`ED3.T,`/_X3EU.=4CG`!(F;P`,2JL`"F<*(DLL)
  764. XM>``$3J[^F!=\`/\`"'#_)T``%'``$"L`#RQX``1.KOZP(DMP(DZN_RY,WT@`Y
  765. XM3G5*@&H``!Y$@$J!:@``#$2!80``($2!3G5A```81(!$@4YU2H%J```,1(%A4
  766. XM```&1(!.=2\"2$$T`68``")(0$A!2$(T`&<```:$P3`"2$`T`(3!,`)(0C("H
  767. XM)!].=2\#=A`,00"`9```!N&944,,00@`9```!NF964,,02``9```!N6954-*7
  768. XM06L```;CF5-#-`#FJ$A"0D+FJDA#@,$V`#`"-`-(0<3!D()D```(4T/0@63^D
  769. XM<@`R`TA#Y[A(0,%!)A\D'TYU2.<#,B9O`!@N+P`<</\L>``$3J[^MBP`#`8`U
  770. XM_V8$<`!@9G`B(CP``0`!3J[_.B1`(`IF"G``$`9.KOZP8$@E2P`*(`<50``);
  771. XM%7P`!``(0BH`#A5&``^3R4ZN_MHE0``0(`MG"")*3J[^GF`:0>H`&"5(`!1!#
  772. XMZ@`4)4@`'$*J`!@5?``"`"`@"DS?3,!.=0``3E7_Q$CG)S`F;P!<)&\`8'X`P
  773. XM?`!Z`'``&WP`(/_[<@`K0?_V=/\K0O_R0>W_T!M`__$;0/_\*T'_Y"M!_^@KF
  774. XM2/_,2A-G+'``$!,$0``@9Q170&<444!G"%5`9A9^`6`.?`%@"GH!8`8;?``!E
  775. XM__Q2BV#0$!-R,+`!9@92BQM!__MP*K`39@P@4EB2*U#_]E*+8`Y(;?_V+PM.U
  776. XMNOTR4$_7P!`3<BZP`68B4HMP*K`39@P@4EB2*U#_\E*+8`Y(;?_R+PM.NOT('
  777. XM4$_7P!`3<FRP`68*&WP``?_Q4HM@"')HL`%F`E*+$!MR`!(`&T#_\`1!`%AGR
  778. XM``%^!$$`"V<``@I306<D!$$`"V<``1)306<``5!706<``;I506<``.1706<`1
  779. XM`5)@``'X2BW_\6<((%)8DB`08`8@4EB2(!`K0/_L;`IR`42M_^PK0?_H2JW_D
  780. XMZ&<$<"U@"DH&9P1P*V`"<"`;0/_0<``0!B(M_^B"@'``$`6"@&<(4JW_S%*M)
  781. XM_^0O+?_L+RW_S$ZZ^ZI03RM`_\@@+?_R2H!J!G(!*T'_\B`M_\@B+?_RDH!(%
  782. XM[0`"_\1O-"!M_\PB2-/!+P`O"2\(3KH"4D_O``QP`!`M__LB+?_$(&W_S&`"B
  783. XM$,!3@63Z("W_\BM`_\C1K?_D0>W_T"M(_\Q*!V<``3`;?``@__M@``$F2BW_E
  784. XM\6<((%)8DB`08`8@4EB2(!`K0/_L8`#_9$HM__%G""!26)(@$&`&(%)8DB`0+
  785. XM*T#_[$HM__QG$B!M_\P0_``P<@$K0?_D*TC_S"\`+RW_S$ZZ^PY03RM`_\A@M
  786. XM`/\R&WP`,/_[("W_\DJ`:@9P""M`__)*+?_Q9P@@4EB2(!!@!B!26)(@$"M`]
  787. XM_^Q*+?_\9Q8@;?_,$/P`,!#\`'AR`BM!_^0K2/_,+P`O+?_,3KKZ\E!/*T#_&
  788. XMR'!8L"W_\&8`_M!(;?_03KKYZEA/8`#^PB!26)(B4"M)_\QF"$'Z`-@K2/_,2
  789. XM(&W_S$H89OQ3B)'M_\PK2/_D("W_\DJ`:R:QP&\B*T#_Y&`<<`$K0/_D(%)8$
  790. XMDB`0&T#_T$(M_]%@!G``8```C"`M_^0B+?_VLH!L"'0`*T+_]F`$D:W_]DH'%
  791. XM9S93K?_D;1AP`"!M_\P0&"\`*TC_S"!M`!!.D%A/8.)3K?_V;4AP`!`M__LO&
  792. XM`"!M`!!.D%A/8.A3K?_V;1)P`!`M__LO`"!M`!!.D%A/8.A3K?_D;1AP`"!M#
  793. XM_\P0&"\`*TC_S"!M`!!.D%A/8.(@"TS?#.1.74YU``!.5?_T2.<!,"9O`"`D'
  794. XM;P`D*VT`$/_V'AI*!V<T<"6^`&8BL!)F!%**8!HO"TAM__8O"F$`_!9/[P`,+
  795. XM*T#_^F<$)$!@TG``$`<O`$Z36$]@QDS?#(!.74YU```@;P`$(F\`""`O``QOD
  796. XM%K/(90S1P-/`$R!3@&;Z3G42V%.`9OI.=0`````#[````!D````````C?```6
  797. XM(F8``")4```B0@``(C```"(>```B#```(@(``"'\```A]@``(?```"'J```AW
  798. XMY```(6H``"%<```A3@``(4```"$R```A)```(/P``"#@```@Q```(*@``"",(
  799. XM```@<````!\````!```C-@``(N8``"+0```A'@``(%0``"*P```BI```(I@`(
  800. XM`"*,```B@```(G0``"'&```AN```(:H``"&<```AC@``(8```"#T```@V```*
  801. XM(+P``""@```@A```(&@``!^Z```?.@``'K(``!X6```==@``'-0```$4````6
  802. XM#@````````/R```#Z@```(@`````````````````````````````````````X
  803. XM``````````!D;W,N;&EB<F%R>0````&H```"2````D@```).```"5````F(`P
  804. XM``)H```"=@```G8```)\```"?````H(```*(```"E@```I8```*<```"G```0
  805. XM`J0```*L```"O````KX```+*```"R@```M0```+D```"_@```OX```,&```#R
  806. XM!@```PP```,2```#(````R8```,T```#.@```T@```-(```#3@```U0````!I
  807. XM``````````$````!`````0````$```````````````$````!````````````&
  808. XM```````````````````````````````````````````@("`@("`@("`H*"@H`
  809. XM*"`@("`@("`@("`@("`@("`@($@0$!`0$!`0$!`0$!`0$!"$A(2$A(2$A(2$(
  810. XM$!`0$!`0$(&!@8&!@0$!`0$!`0$!`0$!`0$!`0$!`0$!$!`0$!`0@H*"@H*"V
  811. XM`@("`@("`@("`@("`@("`@("`@(0$!`0("`@("`@("`@("@H*"@H("`@("`@P
  812. XM("`@("`@("`@("`@2!`0$!`0$!`0$!`0$!`0$(2$A(2$A(2$A(00$!`0$!`00
  813. XM@8&!@8&!`0$!`0$!`0$!`0$!`0$!`0$!`0$0$!`0$!""@H*"@H("`@("`@("4
  814. XM`@("`@("`@("`@("`A`0$!`@```````#[````"<`````````R````,0```#`<
  815. XM````O````+@```"T````L````*P```"H````I````*````"<````F````)0`X
  816. XM``"0````C````(@```"$````@````'P```!X````=````'````!L````:```4
  817. XM`&0```!@````7````%@```!4````4````$P```!(````1````$`````\````P
  818. X1.````#0````P`````````_)4E
  819. X``
  820. Xend
  821. Xsize 12032
  822. END_OF_FILE
  823. if test 16885 -ne `wc -c <'snoopdos.uu'`; then
  824.     echo shar: \"'snoopdos.uu'\" unpacked with wrong size!
  825. fi
  826. # end of 'snoopdos.uu'
  827. fi
  828. if test -f 'snoopglue.s' -a "${1}" != "-c" ; then 
  829.   echo shar: Will not clobber existing file \"'snoopglue.s'\"
  830. else
  831. echo shar: Extracting \"'snoopglue.s'\" \(5668 characters\)
  832. sed "s/^X//" >'snoopglue.s' <<'END_OF_FILE'
  833. X*
  834. X*    SNOOPGLUE.S                        :ts=8
  835. X*
  836. X*    Assembly support routines for snoopdos.c
  837. X*
  838. X*    This file contains routines to patch/unpatch dos library to point
  839. X*    to a C routine, and to call the old routines.
  840. X*
  841. X*    Does some nasty tricks to patch into dos.library. However, since we
  842. X*    checks to see if we are running under 2.0 (with dos.library looking
  843. X*    just like any other library), Snoopdos works fine under 2.0.
  844. X*
  845. X    INCLUDE "exec/types.i"
  846. X    INCLUDE "exec/libraries.i"
  847. X    INCLUDE    "libraries/dosextens.i"
  848. X
  849. X    XDEF    _installdospatch
  850. X    XDEF    _uninstalldospatch
  851. X    XDEF    _CallLock
  852. X    XDEF    _CallOpen
  853. X    XDEF    _CallLoadSeg
  854. X    XDEF    _CallExecute
  855. X    XDEF    _CallCurrentDir
  856. X    XDEF    _CallDeleteFile
  857. X
  858. X    XREF    _DOSBase
  859. X
  860. X    XREF    _NewOpen
  861. X    XREF    _NewLock
  862. X    XREF    _NewLoadSeg
  863. X    XREF    _NewExecute
  864. X    XREF    _NewCurrentDir
  865. X    XREF    _NewDeleteFile
  866. X
  867. X    XREF    _LVOOpen
  868. X    XREF    _LVOLock
  869. X    XREF    _LVOLoadSeg
  870. X    XREF    _LVOExecute
  871. X    XREF    _LVOCurrentDir
  872. X    XREF    _LVODeleteFile
  873. X
  874. XCALL    MACRO
  875. X    XREF    _LVO\1
  876. X    JSR    _LVO\1(A6)
  877. X    ENDM
  878. X
  879. X    SECTION    SnoopDos,CODE
  880. X
  881. X*
  882. X*    Modify DOS library to call our functions for Open() and Lock();
  883. X*    We can't just use SetFunction() because DOS library is non-standard.
  884. X*    Instead of using JMP $123456 type instructions, it uses (mostly)
  885. X*    MOVEQ #funcnum,D0; BRA.L Dispatch. So, we replace this entire
  886. X*    sequence with a standard JMP instruction, steal the number from
  887. X*    the MOVEQ instruction and use it when we want to call the real
  888. X*    DOS library later on.
  889. X*
  890. X_installdospatch:
  891. X    MOVEM.L    A0-A3/A6,-(A7)        * Save regs
  892. X    MOVE.L    4,A6            * Get ExecBase
  893. X    MOVE.L    _DOSBase,A0        * Get DOSbase
  894. X    BSET    #LIBB_CHANGED,LIB_FLAGS(A0) * Indicate changing DOS library
  895. X
  896. XSetFunc    MACRO
  897. X    MOVEM.W    _LVO\1(A0),A1-A3    * Read in current value for func
  898. X    MOVEM.W    A1-A3,\1Save        * Save the appropriate data
  899. X    MOVEM.W CallOur\1,A1-A3        * Read in replacement code
  900. X    MOVEM.W    A1-A3,_LVO\1(A0)    * And modify library
  901. X    ENDM
  902. X
  903. X    SetFunc    Open
  904. X    SetFunc Lock
  905. X    SetFunc LoadSeg
  906. X    SetFunc Execute
  907. X    SetFunc CurrentDir
  908. X    SetFunc DeleteFile
  909. X
  910. X    MOVE.L    A0,A1            * Finally,
  911. X    CALL    SumLibrary        * Recalculate library checksum
  912. X    MOVEM.L    (A7)+,A0-A3/A6        * Save regs
  913. X    RTS
  914. X
  915. X*
  916. X*    Reinstall previous DOS patch. If someone has already altered the
  917. X*    function, we can't actually exit immediately so return a FALSE
  918. X*    result. While there is a very small window which could cause
  919. X*    problems (if someone is in the middle of a SetFunction() when
  920. X*    this is called), but we'll ignore this mostly.
  921. X*
  922. X_uninstalldospatch:
  923. X    MOVEM.L    A0-A3/A6,-(A7)        * Save regs
  924. X    MOVE.L    4,A6            * Get sysbase
  925. X    MOVE.L    _DOSBase,A0        * Get DOSBase
  926. X
  927. XTestFunc MACRO
  928. X    MOVE.L    CallOur\1+2,D0        * Get old address of function
  929. X    CMP.L    _LVO\1+2(A0),D0        * See if changed
  930. X    BNE    changed            * If it has, exit with no action
  931. X    ENDM
  932. X
  933. X    TestFunc Open
  934. X    TestFunc Lock
  935. X    TestFunc LoadSeg
  936. X    TestFunc Execute
  937. X    TestFunc CurrentDir
  938. X    TestFunc DeleteFile
  939. X
  940. X    BSET    #LIBB_CHANGED,LIB_FLAGS(A0) * Indicate changing DOS library
  941. X
  942. XRestFunc MACRO
  943. X    MOVEM.W    \1Save,A1-A3        * Read in prev. value of vec.
  944. X    MOVEM.W    A1-A3,_LVO\1(A0)    * Atomically restore it
  945. X    ENDM
  946. X
  947. X    RestFunc Open
  948. X    RestFunc Lock
  949. X    RestFunc LoadSeg
  950. X    RestFunc Execute
  951. X    RestFunc CurrentDir
  952. X    RestFunc DeleteFile
  953. X
  954. X    MOVE.L    A0,A1            * Finally,
  955. X    CALL    SumLibrary        * Update library checksum
  956. X    MOVEQ    #1,D0            * Indicate success
  957. X    BRA.S    unexit            * And exit
  958. X
  959. Xchanged:
  960. X    MOVEQ    #0,D0            * Indicate failure to uninstall
  961. Xunexit:
  962. X    MOVEM.L    (A7)+,A0-A3/A6        * Restore regs
  963. X    RTS                * And exit with return in D0
  964. X
  965. X*
  966. X*    This code is the code that gets moved directly into the DOS
  967. X*    library vectors
  968. X*
  969. XCallOurOpen:        JMP    NewOpen
  970. XCallOurLock:        JMP    NewLock
  971. XCallOurLoadSeg:        JMP    NewLoadSeg
  972. XCallOurExecute:        JMP    NewExecute
  973. XCallOurCurrentDir:    JMP    NewCurrentDir
  974. XCallOurDeleteFile:    JMP    NewDeleteFile
  975. X
  976. X*
  977. X*    These are the replacement DOS routines.
  978. X*
  979. XNewFunc    MACRO
  980. X    MOVEM.L    A2-A6/D2-D7,-(A7)    * Save all registers (to be safe)
  981. X    JSR    _New\1            * Call C version with params in D1-D3
  982. X    MOVEM.L    (A7)+,A2-A6/D2-D7    * Restore registers
  983. X    MOVE.L    D0,D1            * Copy return value into D1
  984. X*                    * [some routines expect this :-( ]
  985. X    RTS                * Return to caller, exit value in D0
  986. X    ENDM
  987. X
  988. XNewOpen:    NewFunc Open
  989. XNewLock:    NewFunc Lock
  990. XNewLoadSeg:    NewFunc LoadSeg
  991. XNewExecute:    NewFunc Execute
  992. XNewCurrentDir:    NewFunc CurrentDir
  993. XNewDeleteFile:    NewFunc    DeleteFile
  994. X
  995. X*
  996. X*    Allow's C to call the old DOS functions. If we're running Kikstart 2.0
  997. X*    then just call the original function directly. Otherwise, calculate
  998. X*    where to go from the code stored in the vector.
  999. X*
  1000. XOldDosCall MACRO
  1001. X    LEA.L    \1Save,A0    * Get pointer to func save vector
  1002. X    MOVE.W    #_LVO\1,D0    * Get library offset vector
  1003. X    BRA.S    CallDos        * Skip to execute it
  1004. X    ENDM
  1005. X
  1006. X_CallOpen:        OldDosCall Open
  1007. X_CallLock:        OldDosCall Lock
  1008. X_CallLoadSeg:        OldDosCall LoadSeg
  1009. X_CallExecute:        OldDosCall Execute
  1010. X_CallCurrentDir:    OldDosCall CurrentDir
  1011. X_CallDeleteFile:    OldDosCall DeleteFile
  1012. X
  1013. X    NOP                * Stop Lattice messing up final branch
  1014. XCallDos:
  1015. X    MOVEM.L    D1-D3/D6/D7/A6,-(A7)    * Save registers
  1016. X    MOVE.W    (A0),D6            * Get previous instruction
  1017. X    CMP.W    #$4ef9,D6        * Is it a JMP instruction?
  1018. X    BNE    dos_exec        * If not, then call using special code
  1019. X    MOVE.L    2(A0),A0        * Else it's 2.0 or SetFunction()
  1020. X    MOVE.L    _DOSBase,A6        * Put DOSBase into A6 as expected
  1021. X    JSR    (A0)            * Call original function
  1022. X    BRA.S    callexit        * And exit
  1023. X
  1024. Xdos_exec:
  1025. X    MOVE.W    (A0),D6            * Get MOVEQ instruction
  1026. X    EXT.W    D6            * Convert data to word
  1027. X    EXT.L    D6            * and then longword
  1028. X    EXG.L    D0,D6            * Swap with library vector offset
  1029. X    MOVE.W    4(A0),D7        * Get offset to DOS routine from LVO
  1030. X    MOVE.L    _DOSBase,A6        * Get DOSBase 
  1031. X    ADD.W    D6,D7            * Calculate offset value
  1032. X    JSR    4(A6,D7.W)        * Call DOS function dispatcher
  1033. X
  1034. Xcallexit:
  1035. X    MOVEM.L    (A7)+,D1-D3/D6/D7/A6    * Restore registers
  1036. X    RTS                * And return to C caller
  1037. X
  1038. X    SECTION SnoopData,DATA
  1039. X
  1040. XOpenSave    DS.W    3
  1041. XLockSave    DS.W    3
  1042. XLoadSegSave    DS.W    3
  1043. XExecuteSave    DS.W    3
  1044. XCurrentDirSave    DS.W    3
  1045. XDeleteFileSave    DS.W    3
  1046. X
  1047. X    END
  1048. END_OF_FILE
  1049. if test 5668 -ne `wc -c <'snoopglue.s'`; then
  1050.     echo shar: \"'snoopglue.s'\" unpacked with wrong size!
  1051. fi
  1052. # end of 'snoopglue.s'
  1053. fi
  1054. if test -f 'system.h' -a "${1}" != "-c" ; then 
  1055.   echo shar: Will not clobber existing file \"'system.h'\"
  1056. else
  1057. echo shar: Extracting \"'system.h'\" \(271 characters\)
  1058. sed "s/^X//" >'system.h' <<'END_OF_FILE'
  1059. X/* Includes for snoopdos.h */
  1060. X
  1061. X#include <exec/types.h>
  1062. X#include <exec/ports.h>
  1063. X#include <exec/semaphores.h>
  1064. X#include <libraries/dos.h>
  1065. X#include <libraries/dosextens.h>
  1066. X#include <proto/exec.h>
  1067. X#include <proto/dos.h>
  1068. X#include <string.h>
  1069. X#include <dos.h>
  1070. X#include <ctype.h>
  1071. END_OF_FILE
  1072. if test 271 -ne `wc -c <'system.h'`; then
  1073.     echo shar: \"'system.h'\" unpacked with wrong size!
  1074. fi
  1075. # end of 'system.h'
  1076. fi
  1077. if test -f 'tiny.a' -a "${1}" != "-c" ; then 
  1078.   echo shar: Will not clobber existing file \"'tiny.a'\"
  1079. else
  1080. echo shar: Extracting \"'tiny.a'\" \(6132 characters\)
  1081. sed "s/^X//" >'tiny.a' <<'END_OF_FILE'
  1082. X*:ts=8
  1083. X****************************************************************************
  1084. X*                                       *
  1085. X* TINY.A                  (C) Copyright Eddy Carroll 1989  *
  1086. X* ~~~~~~                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  *
  1087. X*                                       *
  1088. X* Replacement startup code for Lattice C V5.04. Use instead of c.o       *
  1089. X* This has many features stripped out to allow small utilities to have       *
  1090. X* as small a filesize as possible. In particular, don't call any of the    *
  1091. X* stdio functions.                               *
  1092. X*                                       *
  1093. X****************************************************************************
  1094. X
  1095. X    INCLUDE "exec/types.i"
  1096. X    INCLUDE "exec/alerts.i"
  1097. X    INCLUDE "exec/nodes.i"
  1098. X    INCLUDE "exec/lists.i"
  1099. X    INCLUDE "exec/ports.i"
  1100. X    INCLUDE "exec/libraries.i"
  1101. X    INCLUDE "exec/tasks.i"
  1102. X    INCLUDE "libraries/dos.i"
  1103. X    INCLUDE "libraries/dosextens.i"
  1104. X    INCLUDE "workbench/startup.i"
  1105. X    INCLUDE "exec/funcdef.i"
  1106. X    INCLUDE "exec/exec_lib.i"
  1107. X    INCLUDE "libraries/dos_lib.i"
  1108. X
  1109. XMAXARGS        EQU 100    ; Maximum number of command line arguments from CLI
  1110. XAbsExecBase EQU 4    ; Welcome to the only fixed point in the universe
  1111. X
  1112. X* A useful macro to let us call library routines
  1113. Xcallsys macro
  1114. X    CALLLIB _LVO\1
  1115. X    endm
  1116. X
  1117. X    xdef    XCEXIT
  1118. X    xdef    exit
  1119. X    xref    LinkerDB
  1120. X    xref    _BSSBAS
  1121. X    xref    _BSSLEN
  1122. X
  1123. X    csect    text,0,0,1,2        * xref's after this are 16-bit reloc
  1124. X    xref    main            * Name of C program to start with.
  1125. X
  1126. Xstart:
  1127. X    movem.l d1-d6/a0-a6,-(a7)
  1128. XREGSIZE EQU    (6+7)*4
  1129. X    lea    REGSIZE(a7),A5        * Determine old stack pointer
  1130. X    move.l    a0,a2            * Save command pointer
  1131. X    move.l    d0,d2            * and command length
  1132. X    lea    LinkerDB,a4        * Load base register
  1133. X
  1134. X    move.l    AbsExecBase.W,a6
  1135. X    move.l    a6,SysBase(A4)
  1136. X    move.l    a7,_StackPtr(A4)    * Save stack ptr
  1137. X
  1138. X    suba.l    a1,a1
  1139. X    callsys    FindTask        * Find out our task ID
  1140. X    move.l    d0,a3
  1141. X
  1142. X    move.l    a5,D0              * get top of stack
  1143. X    sub.l    4(a5),D0        * compute bottom
  1144. X    add.l    #128,D0         * allow for parms overflow
  1145. X    move.l    D0,_base(A4)        * save for stack checking
  1146. X
  1147. X    lea    DOSName(A4),A1
  1148. X    moveq.l    #0,D0
  1149. X    callsys    OpenLibrary
  1150. X    move.l    D0,DOSBase(A4)
  1151. X    bne    getcom
  1152. XnoDOS:
  1153. X    moveq.l #100,d0
  1154. X    bra    exit2
  1155. X
  1156. X*------ find command name:
  1157. Xgetcom:
  1158. X    move.l  pr_CLI(a3),a0
  1159. X    add.l    a0,a0
  1160. X    add.l    a0,a0
  1161. X    move.l    cli_CommandName(a0),a1
  1162. X    add.l    a1,a1
  1163. X    add.l    a1,a1
  1164. X
  1165. X*------ collect parameters:
  1166. X    move.l    d2,d0            * get command line length
  1167. X    moveq.l #0,d1
  1168. X    move.b    (a1)+,d1
  1169. X    move.l    a1,_ProgramName(A4)
  1170. X    add.l    d1,d0            * add length of command name
  1171. X    addq.l    #1,d0            * allow for space after command
  1172. X
  1173. X    clr.w    -(A7)            * set null terminator for command line
  1174. X    addq.l    #1,D0            * force to even number of bytes
  1175. X    andi.w    #$fffe,D0        * (round up)
  1176. X    sub.l    D0,A7            * make room on stack for command line
  1177. X    subq.l    #2,D0
  1178. X    clr.w    0(A7,D0)
  1179. X
  1180. X*------ copy command line onto stack
  1181. X    move.l    d2,d0            * get command line length
  1182. X    subq.l    #1,d0
  1183. X    add.l    d1,d2
  1184. X
  1185. Xcopy_line:
  1186. X    move.b    0(A2,D0.W),0(A7,D2.W)    * copy command line to stack
  1187. X    subq.l    #1,d2
  1188. X    dbf    d0,copy_line
  1189. X    move.b    #' ',0(a7,d2.w)     * add space between command and parms
  1190. X    subq.l    #1,d2
  1191. X
  1192. Xcopy_cmd:
  1193. X    move.b    0(a1,d2.w),0(a7,d2.w)    * copy command name to stack
  1194. X    dbf    d2,copy_cmd
  1195. X    move.l    a7,a1            * Get pointer to new command line
  1196. X
  1197. X    sub.l    #(MAXARGS*4),a7        * Reserve space for argv[]
  1198. X    move.l    a7,a2            * Initialise base into array
  1199. X    move.l    a2,a3            * Save base of argv
  1200. X    moveq    #0,d2            * Initialise argc
  1201. X
  1202. X*
  1203. X* From here on down, A1 is pointer into command line
  1204. X*
  1205. Xbuild_argv:
  1206. X    bsr.s    getnext            * Read next character from line
  1207. X    bcs.s    doquote            * If quote, handle
  1208. X    beq.s    build_argv        * If white space, skip over it
  1209. X
  1210. X    lea    -1(a1),a0        * Get address of this parameter
  1211. X    bsr.s    bumpargv        * Store it to argv[] array
  1212. Xbuild_2:
  1213. X    bsr.s    getnext            * Get next character
  1214. X    bne.s    build_2            * If not white space, keep looking
  1215. X    clr.b    -1(a1)            * Zero-terminate current argument
  1216. X    bra.s    build_argv        * And go back to get next argument
  1217. X
  1218. Xdoquote:
  1219. X    move.l    a1,a0            * Get pointer to this argument
  1220. X    bsr.s    bumpargv        * Output it to argv[]
  1221. Xquote_2:
  1222. X    bsr.s    getnext            * Get next character
  1223. X    bcc.s    quote_2            * If not quote, keep looking
  1224. X    clr.b    -1(a1)            * Zero-terminate current argument
  1225. Xquote_3:
  1226. X    bsr.s    getnext            * Get next character
  1227. X    bne.s    quote_3            * Skip until space reached
  1228. X    beq.s    build_argv        * Go back and read next argument
  1229. X
  1230. Xbumpargv:
  1231. X    move.l    a0,(a2)+        * Output ptr to current argument
  1232. X    addq    #1,d2            * Increment argc
  1233. X    cmpi    #MAXARGS,d2        * Used up all our arguments yet?
  1234. X    bls.s    qrts            * If not, then return
  1235. X    moveq    #110,d0            * Else set return code
  1236. X    bra.s    exit2            * And exit
  1237. X
  1238. X*
  1239. X* Reads next character from command line. If zero, never returns, but
  1240. X* drops into call to main. Else, returns, with C=1 if character is quote,
  1241. X* Z=1 if character is white space.
  1242. X*
  1243. Xgetnext:
  1244. X    move.b    (a1)+,d0        * Get character from command line
  1245. X    beq.s    get_2            * Exit if end of line
  1246. X    cmp.b    #34,d0            * Check if quote
  1247. X    beq.s    isquote            *
  1248. X    cmp.b    #32,d0            * Check if space
  1249. X    beq.s    isspace            *
  1250. X    cmp.b    #9,d0            * Or tab
  1251. X    beq.s    isspace            *
  1252. X    cmp.b    #10,d0            * Or end of line
  1253. Xisspace:
  1254. X    andi    #$1E,ccr        * Clear carry flag, retaining Z
  1255. Xqrts    rts
  1256. X
  1257. Xisquote:
  1258. X    ori    #1,ccr            * Set carry flag
  1259. X    andi    #$FB,ccr        * Clear zero flag
  1260. X    rts                * And return
  1261. X
  1262. Xget_2:
  1263. X    move.l    a3,-(a7)        * Push argv onto stack
  1264. X    move.l    d2,-(a7)        * Push argc onto stack
  1265. X
  1266. X    lea    _BSSBAS,a3        * get base of BSS
  1267. X    moveq    #0,d1
  1268. X    move.l    #_BSSLEN,d0        * get length of BSS in longwords
  1269. X    bra.s    clr_lp            * and clear for length given
  1270. Xclr_bss move.l    d1,(a3)+
  1271. Xclr_lp    dbf    d0,clr_bss
  1272. X
  1273. Xdomain:
  1274. X    jsr    main(PC)        * Call main(argc,argv)
  1275. X    moveq.l #0,d0            * Set successful status
  1276. X    bra.s    exit2
  1277. X
  1278. Xexit:
  1279. X_exit:
  1280. XXCEXIT:
  1281. X    move.l    4(SP),d0        * Extract return code
  1282. Xexit2:
  1283. X    move.l    d0,-(a7)
  1284. X    move.l    AbsExecBase.W,a6
  1285. X    move.l    DOSBase(A4),a1
  1286. X    callsys CloseLibrary        * Close Dos library
  1287. X
  1288. X*------ this rts sends us back to DOS:
  1289. XexitToDOS:
  1290. X    MOVE.L    (A7)+,D0
  1291. X    movea.l _StackPtr(a4),SP    * Restore stack ptr
  1292. X    movem.l (a7)+,d1-d6/a0-a6
  1293. X    rts
  1294. X
  1295. X*-----------------------------------------------------------------------
  1296. X* Global definitions
  1297. X*
  1298. X    csect    __MERGED,1,,2,2
  1299. X
  1300. X    xdef    NULL,SysBase,LoadAddress,DOSBase
  1301. X    xdef    _oserr,_OSERR,_ONBREAK
  1302. X    xdef    _ProgramName,_StackPtr,_base
  1303. X
  1304. XNULL           dc.l    0
  1305. X_base           dc.l    0
  1306. X_oserr           equ     *
  1307. X_OSERR           dc.l    0
  1308. X_ONBREAK       dc.l    0
  1309. XSysBase        dc.l    0
  1310. XLoadAddress    dc.l    0
  1311. X_StackPtr      dc.l    0
  1312. XDOSBase        dc.l    0
  1313. X_ProgramName   dc.l    0
  1314. XDOSName        dc.b    'dos.library',0
  1315. X
  1316. X    END
  1317. END_OF_FILE
  1318. if test 6132 -ne `wc -c <'tiny.a'`; then
  1319.     echo shar: \"'tiny.a'\" unpacked with wrong size!
  1320. fi
  1321. # end of 'tiny.a'
  1322. fi
  1323. echo shar: End of archive 1 \(of 2\).
  1324. cp /dev/null ark1isdone
  1325. MISSING=""
  1326. for I in 1 2 ; do
  1327.     if test ! -f ark${I}isdone ; then
  1328.     MISSING="${MISSING} ${I}"
  1329.     fi
  1330. done
  1331. if test "${MISSING}" = "" ; then
  1332.     echo You have unpacked both archives.
  1333.     rm -f ark[1-9]isdone
  1334. else
  1335.     echo You still need to unpack the following archives:
  1336.     echo "        " ${MISSING}
  1337. fi
  1338. ##  End of shell archive.
  1339. exit 0
  1340. -- 
  1341. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  1342. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  1343. Post requests for sources, and general discussion to comp.sys.amiga.
  1344.